<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="robots" content="index,follow" />
<?php
include_once("../includes/config.php");
?>
<link href="<?php echo $baseurl; ?>default.css" rel="stylesheet" title="Feuille de style principale" type="text/css" media="screen" />
<title>Générateur : Widgets Jamendo</title>
</head>
<body>

<div id="conteneur">

<div id="header">




<div id="col1">
<h1><a href="<?php echo $baseurl; ?>"><?php echo $nameblog; ?></a></h1>
<p class="baseline"><?php echo $baseline; ?></p>
</div>

<?php
include('../includes/pub.php');
?>

</div>

<div id="menu">
<?php
include('../includes/menu.php');
?>
</div>

<div id="blog">

<h2>Générateur de widget Jamendo</h2>

<?php

if($_POST['texte'])
{
$texte = addslashes($_POST['texte']);
$texte = htmlspecialchars($texte);
$texte = stripslashes($texte);

if(preg_match("#^http://(www|blue).jamendo.com/(fr|en|de|es|it|pl|pt|sv|ru|cs|eo)/album/([0-9]+)$#", $texte))
{
$texte = explode("/", $texte);
$code = $texte['5'];
}

elseif(preg_match("#^http://(www|blue).jamendo.com/album/([0-9]+)$#", $texte))
{
$texte = explode("/", $texte);
$code = $texte['4'];
}

else{
echo 'Format d\'adresse non supporté.';
$code = "none";
}

if($code != "none")
{
echo '<h2>Voilà le code à copier-coller :</h2>';
?>
<p>
<textarea name="text" cols="50" rows="10">
<div align="center"><iframe width="302" height="353" src="http://www.jamendo.com/fr/get/track/id/album/id/playerpage/<?php echo $code; ?>/?item_o=track_no_asc&amp;n=all&amp;player_height=353&amp;player_width=302&amp;playercode_type=generic" frameborder="0" style="border:0;width:302px;height:353px;" scrollbars="no">&nbsp;</iframe></div>
</textarea>
<p>

<h2>Aperçu :</h2>
<div align="left"><iframe width="302" height="353" src="http://www.jamendo.com/fr/get/track/id/album/id/playerpage/<?php echo $code; ?>/?item_o=track_no_asc&amp;n=all&amp;player_height=353&amp;player_width=302&amp;playercode_type=generic" frameborder="0" style="border:0;width:302px;height:353px;" scrollbars="no">&nbsp;</iframe></div>

<h2>Un autre album ?</h2>
<?php
}
}
?>
<form  action="" method="post">
<p>

<br />Adresse de l'album :<br />
<input type="text" name="texte" size="50" />
<br />
<input type="submit" value="Donne-moi le code" />
</p>
</form>
<p>Générateur proposé par <a href="http://anothertime.skyrock.com">Anothertime</a>.</p>

</div>

<div id="sidebar-box">

<div id="sidebar">
<?php include('../includes/sidebar_content.php'); ?> </div>

</div>

</div>
</body>
</html>